import imageLoad from './imageLoad'
import createImage from './createImage';
class addPort {
  constructor (param) {
    this.color = param.color
    this.param = param
    this.basePos = param['basePos'] || {x:0, y:0}
    this.ratio = param.ratio
  }
  async draw () {
    let ports = this.param.ports
    for(let i=0; i<ports.length; i++){
      let port = ports[i]
      this.param.ctx.fillStyle = "rgb(0 191 255 / 57%)"; // 设置绘图颜色为红色
      this.param.ctx.fillRect((port.pos.x + this.basePos.x) * this.ratio, (port.pos.y + this.basePos.y) * this.ratio, port.size.width * this.ratio, port.size.height * this.ratio); // 绘制一个 1x1 像素的红点
     // this.ctx.fillRect(20, 20, 20, 10); // 绘制一个 1x1 像素的红点
    }  
  }
}

export default addPort